var JieDataCell = function(aoParentCol, aoParentRow){
	
	if(aoParentCol == null) return;
	JieCell.call(this, aoParentRow);

	this.parentCol = aoParentCol;
	
	this.id = this.parentCol.id;
	this.isFixed = this.parentCol.isFixed;
	this.element.name = this.id;
	this.editType = "show";
	this.elEditer = null;
//alert(this.setWidth);
	this.setWidth(aoParentCol.iWidth);

//	this.element.className = "JieCell";
	this.editCell = function(){
		//alert(!this.parentCol.isShow);
		if (!this.parentCol.isShow) {
			this.element.focus();
			return false;
		}
		if(!this.parentCol.isEdit){
//			return false;
//			this.elEditer.disabled = true;
		}
//		alert(this.parentCol.isEdit);
		if(this.editType == "edit"){
			this.element.focus();
			return false;
		}
		Util.removeChild(this.element);
		
//		alert("JieDataCell");
		this.elEditer = Util.gfn_addChild(this.element, "input", "type", "input", "value", this.value, "width", this.getWidth(), "height", this.getHeight());

		this.elEditer.style.backgroundColor = this.getBgColor();
//	alert(this.dateForeColor);
		this.elEditer.style.color = this.getForeColor();
		this.elEditer.style.fontFamily = this.getFontFamily();
		this.elEditer.style.fontSize = this.getFontSize();
		if(!this.parentCol.isEdit){
			this.elEditer.style.cursor = "default";
			this.elEditer.readOnly = true;
//			this.elEditer.disabled = true;
		}
//		this.elEditer.alt = this.value;
		
		this.elEditer.focus();
		this.editType = "edit";
		return true;
	};
	this.closeCell = function(){
		//alert(!this.parentCol.isShow);
		if(!this.parentCol.isShow) return;
		if(this.editType == "show") return;
	
		var sValue = this.elEditer.value
		this.elEditer = null;
		
		Util.removeChild(this.element);
		this.setValue(sValue);
		this.editType = "show";
	};
	this.setValue = function(asValue){
		if (!this.elEditer) {
			Util.removeChild(this.element);
			this.element.appendChild(document.createTextNode(asValue));
		}else{
			this.elEditer.value = asValue;		
		}
		this.value = asValue;

	};
	this.parentCol.appendCell(this);
};

JieDataCell.prototype = JieCell.prototype;

